﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using ZH.Service.Instance;
using ZH.Service.Interface;

namespace ZH.Api.Admin.Controllers.Admin
{
    

    /// <summary>
    /// 管理端·预约
    /// </summary>
    public class ReservationController : BaseController
    {
        private readonly I_Reservation_Service _reservation_Service;

        public ReservationController(I_Login_Service login_Service,I_Reservation_Service reservation_Service) : base(login_Service)
        {
            _reservation_Service= reservation_Service;
        }

        /// <summary>
        /// 获取预约列表
        /// </summary>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <param name="key"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult> Get_reservationList(int? page=1,int? limit=10,string? key="",string? time="") {

            var result = await _reservation_Service.Get_reservationList(
                page: page,
                limit: limit,
                key: key,
                time:time
                );
            return Ok(result);
        }


        /// <summary>
        /// 获取今日预约列表
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult> Get_today(int? page=1,int? limit=10,string? key="") {

            var result = await _reservation_Service.Get_today(
                page:page,
                limit: limit,
                key: key    
                );
           
            return Ok(result);



        }
    }
}
